// 实现这个项目的构建任务
const {src, dest} = require('gulp');
const browserSync = require('browser-sync');
const loadPlugins = require('gulp-load-plugins');
const del = require('del')

const plugins = loadPlugins();
const bs = browserSync.create();

const data = {

}

const clean = () => {
  return del(['dist', 'temp']);
}

const style = () => {
  return src('src/assets/styles/*.scss', { base: 'src' })
    .pipe(plugins.sass({outputStyle: 'expanded'}))
    .pipe(dest('temp'))
    .pipe(bs.reload({stream: true}))
}

const script = () => {
  return src('src/assets/scripts/*.js', { base: 'src' })
    .pipe(plugins.babel({ presets: ['@babel/preset-env'] }))
    .pipe(dest('temp'))
    .pipe(bs.reload({ stream: true }))
}

const page = () => {
  return src('src/*.html', { base: 'src' })
    .pipe(plugins.swig({ data }))
    .pipe(dest('temp'))
    .pipe(bs.reload({ stream: true }))
}

const image = () => {

}

const font = () => {

}

 const extra = () => {

 }

 const serve = () => {

 }